.class public Lcom/xingbook/park/c/a/r;
.super Landroid/widget/HorizontalScrollView;


# instance fields
.field private a:Landroid/widget/LinearLayout;

.field private b:Lcom/xingbook/park/b/f;

.field private c:Landroid/app/Activity;

.field private d:F

.field private e:Lcom/xingbook/park/c/a/m;


# direct methods
.method public constructor <init>(Landroid/app/Activity;FLcom/xingbook/park/c/a/m;)V
    .locals 4

    const/4 v2, -0x2

    const/4 v3, 0x0

    invoke-virtual {p1}, Landroid/app/Activity;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    invoke-direct {p0, v0}, Landroid/widget/HorizontalScrollView;-><init>(Landroid/content/Context;)V

    iput-object p1, p0, Lcom/xingbook/park/c/a/r;->c:Landroid/app/Activity;

    iput p2, p0, Lcom/xingbook/park/c/a/r;->d:F

    iput-object p3, p0, Lcom/xingbook/park/c/a/r;->e:Lcom/xingbook/park/c/a/m;

    invoke-virtual {p1}, Landroid/app/Activity;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    new-instance v1, Landroid/widget/LinearLayout;

    invoke-direct {v1, v0}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;)V

    iput-object v1, p0, Lcom/xingbook/park/c/a/r;->a:Landroid/widget/LinearLayout;

    iget-object v0, p0, Lcom/xingbook/park/c/a/r;->a:Landroid/widget/LinearLayout;

    invoke-virtual {v0, v3}, Landroid/widget/LinearLayout;->setOrientation(I)V

    new-instance v0, Landroid/widget/FrameLayout$LayoutParams;

    invoke-direct {v0, v2, v2}, Landroid/widget/FrameLayout$LayoutParams;-><init>(II)V

    iget-object v1, p0, Lcom/xingbook/park/c/a/r;->a:Landroid/widget/LinearLayout;

    invoke-virtual {v1, v0}, Landroid/widget/LinearLayout;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    iget-object v0, p0, Lcom/xingbook/park/c/a/r;->a:Landroid/widget/LinearLayout;

    const/4 v1, -0x1

    const/4 v2, 0x1

    invoke-static {v1, v2}, Lcom/xingbook/park/c/a/y;->a(IZ)I

    move-result v1

    int-to-float v1, v1

    mul-float/2addr v1, p2

    float-to-int v1, v1

    invoke-virtual {v0, v3, v3, v1, v3}, Landroid/widget/LinearLayout;->setPadding(IIII)V

    iget-object v0, p0, Lcom/xingbook/park/c/a/r;->a:Landroid/widget/LinearLayout;

    invoke-virtual {p0, v0}, Lcom/xingbook/park/c/a/r;->addView(Landroid/view/View;)V

    return-void
.end method


# virtual methods
.method public a(Lcom/xingbook/park/b/f;Z)V
    .locals 11

    const/4 v3, 0x1

    const/4 v4, 0x0

    const/4 v10, -0x2

    iget-object v0, p0, Lcom/xingbook/park/c/a/r;->b:Lcom/xingbook/park/b/f;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/park/c/a/r;->b:Lcom/xingbook/park/b/f;

    invoke-virtual {v0}, Lcom/xingbook/park/b/f;->b()I

    move-result v0

    invoke-static {v0}, Lcom/xingbook/c/t;->g(I)I

    move-result v0

    invoke-virtual {p1}, Lcom/xingbook/park/b/f;->b()I

    move-result v1

    invoke-static {v1}, Lcom/xingbook/c/t;->g(I)I

    move-result v1

    if-eq v0, v1, :cond_0

    iget-object v0, p0, Lcom/xingbook/park/c/a/r;->a:Landroid/widget/LinearLayout;

    invoke-virtual {v0}, Landroid/widget/LinearLayout;->removeAllViews()V

    :cond_0
    iput-object p1, p0, Lcom/xingbook/park/c/a/r;->b:Lcom/xingbook/park/b/f;

    iget-object v0, p0, Lcom/xingbook/park/c/a/r;->a:Landroid/widget/LinearLayout;

    invoke-virtual {v0}, Landroid/widget/LinearLayout;->getChildCount()I

    move-result v6

    invoke-virtual {p1}, Lcom/xingbook/park/b/f;->g()Ljava/util/ArrayList;

    move-result-object v7

    invoke-virtual {v7}, Ljava/util/ArrayList;->size()I

    move-result v8

    if-lt v6, v8, :cond_7

    add-int/lit8 v0, v6, -0x1

    move v5, v0

    :goto_0
    if-gez v5, :cond_2

    :cond_1
    return-void

    :cond_2
    invoke-virtual {v7, v5}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/b/n;

    if-ge v5, v8, :cond_6

    iget-object v1, p0, Lcom/xingbook/park/c/a/r;->a:Landroid/widget/LinearLayout;

    invoke-virtual {v1, v5}, Landroid/widget/LinearLayout;->getChildAt(I)Landroid/view/View;

    move-result-object v2

    move-object v1, v2

    check-cast v1, Lcom/xingbook/park/c/a/n;

    invoke-interface {v1}, Lcom/xingbook/park/c/a/n;->getResType()I

    move-result v1

    invoke-virtual {v0}, Lcom/xingbook/b/n;->s()I

    move-result v6

    if-ne v1, v6, :cond_4

    check-cast v2, Lcom/xingbook/park/c/a/n;

    invoke-virtual {v7, v5}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/b/n;

    invoke-virtual {p1}, Lcom/xingbook/park/b/f;->b()I

    move-result v1

    invoke-interface {v2, v0, v1, p2}, Lcom/xingbook/park/c/a/n;->a(Lcom/xingbook/b/n;IZ)V

    :cond_3
    :goto_1
    add-int/lit8 v0, v5, -0x1

    move v5, v0

    goto :goto_0

    :cond_4
    iget-object v1, p0, Lcom/xingbook/park/c/a/r;->a:Landroid/widget/LinearLayout;

    invoke-virtual {v1, v5}, Landroid/widget/LinearLayout;->removeViewAt(I)V

    iget-object v1, p0, Lcom/xingbook/park/c/a/r;->e:Lcom/xingbook/park/c/a/m;

    invoke-virtual {v0}, Lcom/xingbook/b/n;->s()I

    move-result v2

    invoke-interface {v1, v2}, Lcom/xingbook/park/c/a/m;->a(I)Lcom/xingbook/park/c/a/n;

    move-result-object v2

    if-eqz v2, :cond_3

    invoke-virtual {v7, v5}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/xingbook/b/n;

    invoke-virtual {p1}, Lcom/xingbook/park/b/f;->b()I

    move-result v6

    invoke-interface {v2, v1, v6, p2}, Lcom/xingbook/park/c/a/n;->a(Lcom/xingbook/b/n;IZ)V

    new-instance v1, Landroid/widget/LinearLayout$LayoutParams;

    invoke-direct {v1, v10, v10}, Landroid/widget/LinearLayout$LayoutParams;-><init>(II)V

    invoke-virtual {v0}, Lcom/xingbook/b/n;->s()I

    move-result v6

    if-nez v5, :cond_5

    move v0, v3

    :goto_2
    invoke-static {v6, v0}, Lcom/xingbook/park/c/a/y;->a(IZ)I

    move-result v0

    int-to-float v0, v0

    iget v6, p0, Lcom/xingbook/park/c/a/r;->d:F

    mul-float/2addr v0, v6

    float-to-int v0, v0

    iput v0, v1, Landroid/widget/LinearLayout$LayoutParams;->leftMargin:I

    move-object v0, v2

    check-cast v0, Landroid/view/View;

    invoke-virtual {v0, v1}, Landroid/view/View;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    iget-object v0, p0, Lcom/xingbook/park/c/a/r;->a:Landroid/widget/LinearLayout;

    check-cast v2, Landroid/view/View;

    invoke-virtual {v0, v2, v5}, Landroid/widget/LinearLayout;->addView(Landroid/view/View;I)V

    goto :goto_1

    :cond_5
    move v0, v4

    goto :goto_2

    :cond_6
    iget-object v0, p0, Lcom/xingbook/park/c/a/r;->a:Landroid/widget/LinearLayout;

    invoke-virtual {v0, v5}, Landroid/widget/LinearLayout;->removeViewAt(I)V

    goto :goto_1

    :cond_7
    move v5, v4

    :goto_3
    if-ge v5, v8, :cond_1

    invoke-virtual {v7, v5}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/b/n;

    if-ge v5, v6, :cond_c

    iget-object v1, p0, Lcom/xingbook/park/c/a/r;->a:Landroid/widget/LinearLayout;

    invoke-virtual {v1, v5}, Landroid/widget/LinearLayout;->getChildAt(I)Landroid/view/View;

    move-result-object v2

    move-object v1, v2

    check-cast v1, Lcom/xingbook/park/c/a/n;

    invoke-interface {v1}, Lcom/xingbook/park/c/a/n;->getResType()I

    move-result v1

    invoke-virtual {v0}, Lcom/xingbook/b/n;->s()I

    move-result v9

    if-ne v1, v9, :cond_9

    check-cast v2, Lcom/xingbook/park/c/a/n;

    invoke-virtual {v7, v5}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/b/n;

    invoke-virtual {p1}, Lcom/xingbook/park/b/f;->b()I

    move-result v1

    invoke-interface {v2, v0, v1, p2}, Lcom/xingbook/park/c/a/n;->a(Lcom/xingbook/b/n;IZ)V

    :cond_8
    :goto_4
    add-int/lit8 v0, v5, 0x1

    move v5, v0

    goto :goto_3

    :cond_9
    iget-object v1, p0, Lcom/xingbook/park/c/a/r;->a:Landroid/widget/LinearLayout;

    invoke-virtual {v1, v5}, Landroid/widget/LinearLayout;->removeViewAt(I)V

    iget-object v1, p0, Lcom/xingbook/park/c/a/r;->e:Lcom/xingbook/park/c/a/m;

    invoke-virtual {v0}, Lcom/xingbook/b/n;->s()I

    move-result v2

    invoke-interface {v1, v2}, Lcom/xingbook/park/c/a/m;->a(I)Lcom/xingbook/park/c/a/n;

    move-result-object v2

    if-eqz v2, :cond_b

    invoke-virtual {v7, v5}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/xingbook/b/n;

    invoke-virtual {p1}, Lcom/xingbook/park/b/f;->b()I

    move-result v9

    invoke-interface {v2, v1, v9, p2}, Lcom/xingbook/park/c/a/n;->a(Lcom/xingbook/b/n;IZ)V

    new-instance v1, Landroid/widget/LinearLayout$LayoutParams;

    invoke-direct {v1, v10, v10}, Landroid/widget/LinearLayout$LayoutParams;-><init>(II)V

    invoke-virtual {v0}, Lcom/xingbook/b/n;->s()I

    move-result v9

    if-nez v5, :cond_a

    move v0, v3

    :goto_5
    invoke-static {v9, v0}, Lcom/xingbook/park/c/a/y;->a(IZ)I

    move-result v0

    int-to-float v0, v0

    iget v9, p0, Lcom/xingbook/park/c/a/r;->d:F

    mul-float/2addr v0, v9

    float-to-int v0, v0

    iput v0, v1, Landroid/widget/LinearLayout$LayoutParams;->leftMargin:I

    move-object v0, v2

    check-cast v0, Landroid/view/View;

    invoke-virtual {v0, v1}, Landroid/view/View;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    iget-object v0, p0, Lcom/xingbook/park/c/a/r;->a:Landroid/widget/LinearLayout;

    check-cast v2, Landroid/view/View;

    invoke-virtual {v0, v2, v5}, Landroid/widget/LinearLayout;->addView(Landroid/view/View;I)V

    goto :goto_4

    :cond_a
    move v0, v4

    goto :goto_5

    :cond_b
    new-instance v0, Lcom/xingbook/park/c/a/s;

    invoke-virtual {p0}, Lcom/xingbook/park/c/a/r;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-direct {v0, p0, v1}, Lcom/xingbook/park/c/a/s;-><init>(Lcom/xingbook/park/c/a/r;Landroid/content/Context;)V

    iget-object v1, p0, Lcom/xingbook/park/c/a/r;->a:Landroid/widget/LinearLayout;

    check-cast v0, Landroid/view/View;

    invoke-virtual {v1, v0, v5}, Landroid/widget/LinearLayout;->addView(Landroid/view/View;I)V

    goto :goto_4

    :cond_c
    iget-object v1, p0, Lcom/xingbook/park/c/a/r;->e:Lcom/xingbook/park/c/a/m;

    invoke-virtual {v0}, Lcom/xingbook/b/n;->s()I

    move-result v2

    invoke-interface {v1, v2}, Lcom/xingbook/park/c/a/m;->a(I)Lcom/xingbook/park/c/a/n;

    move-result-object v2

    if-eqz v2, :cond_8

    invoke-virtual {v7, v5}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/xingbook/b/n;

    invoke-virtual {p1}, Lcom/xingbook/park/b/f;->b()I

    move-result v9

    invoke-interface {v2, v1, v9, p2}, Lcom/xingbook/park/c/a/n;->a(Lcom/xingbook/b/n;IZ)V

    new-instance v1, Landroid/widget/LinearLayout$LayoutParams;

    invoke-direct {v1, v10, v10}, Landroid/widget/LinearLayout$LayoutParams;-><init>(II)V

    invoke-virtual {v0}, Lcom/xingbook/b/n;->s()I

    move-result v9

    if-nez v5, :cond_d

    move v0, v3

    :goto_6
    invoke-static {v9, v0}, Lcom/xingbook/park/c/a/y;->a(IZ)I

    move-result v0

    int-to-float v0, v0

    iget v9, p0, Lcom/xingbook/park/c/a/r;->d:F

    mul-float/2addr v0, v9

    float-to-int v0, v0

    iput v0, v1, Landroid/widget/LinearLayout$LayoutParams;->leftMargin:I

    move-object v0, v2

    check-cast v0, Landroid/view/View;

    invoke-virtual {v0, v1}, Landroid/view/View;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    iget-object v0, p0, Lcom/xingbook/park/c/a/r;->a:Landroid/widget/LinearLayout;

    check-cast v2, Landroid/view/View;

    invoke-virtual {v0, v2}, Landroid/widget/LinearLayout;->addView(Landroid/view/View;)V

    goto/16 :goto_4

    :cond_d
    move v0, v4

    goto :goto_6
.end method

.method public getResType()I
    .locals 1

    iget-object v0, p0, Lcom/xingbook/park/c/a/r;->b:Lcom/xingbook/park/b/f;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/park/c/a/r;->b:Lcom/xingbook/park/b/f;

    invoke-virtual {v0}, Lcom/xingbook/park/b/f;->b()I

    move-result v0

    :goto_0
    return v0

    :cond_0
    const/4 v0, -0x1

    goto :goto_0
.end method

.method public setData(Lcom/xingbook/park/b/f;)V
    .locals 1

    const/4 v0, 0x0

    invoke-virtual {p0, p1, v0}, Lcom/xingbook/park/c/a/r;->a(Lcom/xingbook/park/b/f;Z)V

    return-void
.end method
